﻿//--------------------------------------------------------------------------------------------------------------------- 
// <copyright file="LibraryTraceHelper.cs" company="Collaboris Ltd">
//   Copyright (c) Collaboris Ltd. All rights reserved.
// </copyright>
// <summary>
//   Defines the LibraryTraceHelper type.
// </summary>
//---------------------------------------------------------------------------------------------------------------------
namespace Collaboris.SharePoint.Wss.Tracing
{
    using System.Diagnostics;

    using Collaboris.Utils;

    /// <summary>
    /// Defines the trace helper for Library classes. The name of the TraceSwitch used by this helper is "LibraryTrace".
    /// <remarks>
    /// To see trace messages used by this TraceHelper the following entry need to be added to the application configuration file (replace x with the required trace level):
    /// <code>
    /// <configuration>
    /// <system.diagnostics>
    ///  <switches>
    ///    <add name="LibraryTrace" value="x" />
    ///  </switches>
    /// </system.diagnostics>
    /// </configuration>
    /// </code>
    /// </remarks>
    /// </summary>
    public class LibraryTraceHelper : TraceHelper
    {
        private static TraceSwitch traceSwitch = new TraceSwitch("LibraryTrace", "Trace switch for the library");

        public static TraceSwitch TraceSwitch
        {
            get
            {
                return traceSwitch;
            }
        }        

        #region Constructors 

        public LibraryTraceHelper(string ownerClassName) : base(ownerClassName, traceSwitch)
        {
        }

        public LibraryTraceHelper(object OwnerClass) : base(OwnerClass, traceSwitch)
        {
        }

        #endregion Constructors 
    }
}